| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | Mivhak.component('dropdown', { |
||
| 10 | $.each(this.items, function(i, item) { |
||
| 11 | if( typeof item === 'string') item = Mivhak.buttons[item]; |
||
| 12 | var button = $('<div>',{class: 'mivhak-dropdown-button', text: item.text, click: function(e){item.click.call($this.mivhakInstance,e);}}); |
||
| 13 | if(item.toggle) |
||
| 14 | { |
||
| 15 | button.$toggle = Mivhak.render('toggle'); |
||
| 16 | |||
| 17 | // Toggle only if not clicking on the toggle itself (which makes it toggle as it is) |
||
| 18 | button.click(function(e){if($(e.target).parents('.mivhak-dropdown-button').length !== 1)button.$toggle.toggle();}); |
||
| 19 | button.append(button.$toggle.$el); |
||
| 20 | } |
||
| 21 | $this.$el.append(button); |
||
| 22 | }); |
||
| 23 | |||
| 38 | }); |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.